<?php

class WrappedIterator implements Iterator {
  var $iterator;
  function __construct($iterator){
    $this->iterator = $iterator;
  }
  
  function rewind() {
	$this->iterator->rewind();
  }
  function current() {
	return $this->iterator->current();
  }
  function key() {
    return $this->iterator->key();
  }
  function next() {
    $this->iterator->next();
	if ( $this->valid() ) {
	  return $this->current();   // this means only current needs to be overridden to change return values
	} else {
	  return false;
	}
  }
  function valid() {
    return $this->iterator->valid();
  }
}


?>